package com.young.design.pattern.proxy.staticproxy;


import com.young.design.pattern.proxy.Subject;

/**
 * @ClassName : Proxy
 * @Author : hyy
 * @Date: 2020-03-19
 */
public class Proxy {
    /**
     * 要被代理的委托类
     */
    private Subject subject;

    public Proxy(Subject subject) {
        this.subject = subject;
    }


    public void request() {
        before();
        subject.request();
        after();
    }

    private void before(){
        System.out.println("调用真是对象处理业务之前");
    }

    private void after(){
        System.out.println("调用真是对象处理业务之后");
    }


}
